package com.imut.lagain.mapper;
import org.slf4j.LoggerFactory;

import com.imut.lagain.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 用户自定义查询Mapper接口
 */
@Mapper
public interface UserCustomMapper {
    
    /**
     * 根据unionId查询用户
     * @param unionId 微信unionId
     * @return 用户信息
     */
    @Select("SELECT id, openid, unionid, nickname, avatar_url, phone, email, " + 
            "create_time, update_time, is_active, is_deleted, delete_time " + 
            "FROM user WHERE unionid = #{unionId}")
    User selectByUnionId(@Param("unionId") String unionId);
}
